package cn.com.zetatech.loader.common.service;

import org.apache.kafka.clients.consumer.OffsetAndMetadata;
import org.apache.kafka.clients.producer.RecordMetadata;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.header.Header;

import java.util.List;
import java.util.Map;

/**
 * @author zhengbs
 */
public interface KafkaService {

    RecordMetadata sendMessage(String topic, String message, List<Header> headers) throws Exception;

    RecordMetadata sendMessage(String topic, String key, String message, List<Header> headers) throws Exception;

    void commit(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets);
}
